﻿/*!	@file	r_draw_rasterizerState.h
	@brief	ラスタステート
Copyright (c) 2010 Yuya Yamaguchi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef _R_DRAW_RASTERIZERSTATE_H_
#define _R_DRAW_RASTERIZERSTATE_H_

#include "../rtti/r_rtti_class_base.h"
#include "../math/r_math_colorRGBf.h"
#include "r_draw_def.h"
#include "../alloc/r_alloc_new_delete.h"

namespace r{
	namespace draw{
		//! ラスタステートの定義
		struct RasterizerDesc {
			RasterizerDesc()
				:
				fillMode ( FillMode_Solid ),
				cullMode ( CullMode_Back ),
				frontCounterClockwise ( false ),
				depthBias ( 0 ),
				depthBiasClamp ( 0.0f ),
				slopeScaledDepthBias ( 0.0f ),
				depthClipEnable ( true ),
				scissorEnable ( false ),
				multisampleEnable ( false ),
				antialiasedLineEnable ( false ) {
			}
			r_ui32		fillMode;				//!< フィルモード
			r_ui32		cullMode;				//!< カリングモード
			r_bool		frontCounterClockwise;	//!<
			r_si32		depthBias;				//!< 深度バイアス値
			r_f32		depthBiasClamp;			//!< 深度最大値
			r_f32		slopeScaledDepthBias;	//!< ピクセル勾配値
			r_bool		depthClipEnable;		//!< 深度クリップの有効/無効
			r_bool		scissorEnable;			//!< シザークリップの有効/無効
			r_bool		multisampleEnable;		//!< マルチサンプルの有効/無効
			r_bool		antialiasedLineEnable;	//!< ラインアンチエイリアシングの有効/無効
		};

		//! ラスタステートクラス
		/*!
		*/
		class RasterizerState : public r::rtti::ClassBase
		{
			RRTTI_REFLECTION_DECLARE
		public:
			RALLOC_PLACEMENT_NEW_DELETE_DECLEARE
		protected:
			//! コンストラクタ
			RasterizerState( void );
			//! デストラクタ
			virtual ~RasterizerState( void );
		public:
			//! 生成関数
			static RasterizerState*		create( const RasterizerDesc& desc );
			//! 破棄関数
			virtual void	destroy( void );
		protected:
		private:
		};
	}
}



#endif // _R_DRAW_RASTERIZERSTATE_H_
